Combining Kanzi Studio projects into a Kanzi application

You can combine the content of several Kanzi Studio projects into a single Kanzi application. This enables you to:

For example, when you are developing an in-vehicle infotainment application consisting of several applications, you can develop each of these applications in one or more Kanzi Studio projects. You then use one Kanzi application to combine these Kanzi Studio projects into a single Kanzi application.

To combine Kanzi Studio projects into a single Kanzi application:

To use theming and localization when you combine multiple Kanzi Studio projects into a Kanzi application, you must make the theme groups and localization tables accessible to the Screen node of the main project of your application. See Using theming and localization in multiple Kanzi Studio projects combined into a Kanzi application.

Learn how to combine content from Kanzi Studio projects by completing a tutorial. See Tutorial: Combine Kanzi Studio projects into a single Kanzi application.

Kanzi Studio solution structure

A Kanzi Studio solution is a Kanzi Studio project which you use to combine Kanzi applications into a single Kanzi application.

When you create a Kanzi solution, use these guidelines:

When you add Kanzi Studio projects to a Kanzi solution, use these guidelines:

Using prefabs and resources from Kanzi Studio projects

To use prefabs and resources from Kanzi Studio projects:

  1. Open or create a Kanzi Studio project in which you want to use content from other Kanzi Studio projects.
    From here on this project is referred to as the referencing project.
  2. In the Library press Alt and right-click Project References, select Existing Project, select a Kanzi Studio project from which you want to use content in the referencing project, and click Open.
    Kanzi Studio loads the project in a new tab. If that project contains project references, Kanzi Studio loads the projects to which the references point.
    From here on these projects are referred to as the referenced projects.
    In the project tabs the Preview icon marks the project which is active in the Preview.
    TIP

    To view a project in the Preview, in the project tab right-click the tab of that project and select Show in Preview.

    TIP

    The order of project references in the Library > Project References determines the order in which Kanzi loads the kzb files of the projects when you run your application.

  3. In the Preview click Restart and in the Kzb export dialog click Yes to export the kzb files of the referenced projects.
    Kanzi Studio creates the kzb file and configuration files from the referenced projects.
    This way you make the content of the referenced projects available to the Preview of the referencing project.
    TIP

    By default when you start or restart the Preview Kanzi Studio asks whether you want to export the kzb files of the referenced projects. To set Kanzi Studio to always export the kzb files without asking, either:

    • In the Kzb export dialog enable the Do not ask me again option and click Yes.
    • Select Edit > User Preferences and in the Advanced tab set the value of the Referenced project kzb file export behavior setting to Always export.
    TIP

    When the project that Kanzi Studio shows in the Preview or any of the referenced projects contain changes that you have not yet exported to the kzb files of the projects, in the Preview the Restart button is orange.
    To see the projects whose content in the Preview is outdated, hover over the button.

  4. In the project tab bar select the referenced project from which you want to use a prefab or resource.
  5. To make prefabs and resources available in Kanzi Studio in the dropdown menus of the referencing project either:
  6. Use the content from the referenced project:
  7. (Optional) Customize and control the appearance of prefabs. See Customizing and controlling prefabs from Kanzi Studio projects.

Using prefabs and resources from kzb files

To use prefabs and resources from kzb files:

  1. Open or create a Kanzi Studio project in which you want to use content from a kzb file.
  2. In the Library press Alt and right-click Project References, select Existing .kzb, select a kzb file from which you want to use content in the target project, and click Open.
    If the kzb file refers to other kzb files, you must also add the references to those kzb files.
  3. Use content from the kzb file:

Customizing and controlling prefabs from Kanzi Studio projects

In a Kanzi solution when you use prefabs from a Kanzi Studio project, you can set the content and appearance of these prefabs. You can do this by using a property type in the root node of each prefab which you bind to the prefab content that you want to control.

To control prefabs from Kanzi Studio projects:

  1. Open or create a project and add to that project a prefab from a Kanzi Studio project. See Using prefabs and resources from Kanzi Studio projects.
    From here on this project is referred to as the target project.
  2. In the project tab bar select the project which contains the prefab that you want to control, in the Prefabs select the prefab, and in the Properties next to the property with which you want to control the prefab click .
    Kanzi Studio creates from that property a custom property, adds it to the root of the prefab, and creates a ##Template binding to the property in the prefab root. This enables you to edit the appearance of the prefab from the root of the prefab.
    For example, if you want to control the progress bar of a music player using a property called Progress, click next to that property.
    From here on this project is referred to as the source project.
  3. In the Preview click to restart the Preview, and export the kzb file of the source project.
  4. In the project tab bar select the target project, in the Project select the node you use to instantiate the prefab from the source project that you want to control, and in the Properties add the custom property you created in the previous step.
    You can now use the property in the target project to control the prefab from the source project.

Merging content from referenced Kanzi Studio projects

When you want to bring content from referenced Kanzi Studio projects you can merge the items you need.

To merge content from referenced Kanzi Studio projects, in the Library > Project References right-click the source project from which you want to bring content and select Merge Project.
Merge Project allows you to import only the selected items to the target project. When merging you can select which project items you want to import and resolve conflicts for items that exist in both projects. Kanzi Studio merges nodes from the source project to a new prefab. Kanzi Studio creates the nodes and resources even if they exist in the target project and you have not merged it before from the same project reference (in which case it is marked as identical). See Merging projects.

Loading projects that refer to the same referenced project

Kanzi Studio does not support loading of the same project in multiple instances of Kanzi Studio. In the Library Kanzi Studio marks with red type project references that are already loaded in another instance of Kanzi Studio. If the kzb file of that project exists, the Kanzi Studio Preview shows the content of that kzb file. If you unload a referenced project, the Preview does not show the content of that project.

When you want to load a Kanzi Studio project as a project reference in multiple Kanzi Studio projects, make those projects part of the same Kanzi Studio solution.
For example, if you have Kanzi Studio solutions named MainProject1 and MainProject2, which both contain a project reference to the Resources project:

  1. Create a Kanzi Studio project.
  2. In the Library > Project References create project references for the MainProject1 and MainProject2 Kanzi Studio projects.

You can now use the same instance of Kanzi Studio to edit the MainProject1, MainProject2, and Resources projects.

Using theming and localization in multiple Kanzi Studio projects combined into a Kanzi application

To use theming and localization when you combine multiple Kanzi Studio projects into a Kanzi application, you must make the theme groups and localization tables accessible to the Screen node of the main project of your application in one of these ways:

See also

Tutorial: Combine Kanzi Studio projects into a single Kanzi application

Importing projects

Merging projects

Using prefabs

Theming your applications

Localization